package DB;


import java.util.Set;


public interface DBmanager 
{	
	/**
	 * this function add new tag if it doesn't exist
	 * @param tag {@link String} the name of the tag
	 * @return {@link TagsTable} an instance of the new tag or null if it exist   
	 */
	public TagsTable addTag(String tag);
	/**
	 * this function connect between file and tag 
	 * @param fileName {@link String} the name of the requested file
	 * @param tag {@link String}  the name of the tag
	 * @param path {@link String}  the path of the file
	 * @return {@link Boolean} true if the operation succeed or false if not
	 */
	public boolean addTagToFile( String fileName, String tag, String path);
	/**
	 * this function remove a tag from requested file
	 * @param tag {@link String} the name of the tag
	 * @param path {@link String} the path of the file
	 * @return {@link Boolean} true if the operation succeed or false if not
	 */
	public boolean delTagFromFile(String tag, String path);
	/**
	 * this function delete all the tags from the system
	 */
	public void delAllTags();
	/**
	 * this function delete all the files from the system
	 */
	public void delAllFiles();
	/**
	 * this function delete the requested tag from the system
	 * @param tag {@link String} the name of the tag
	 * @return {@link Boolean} true if the operation succeed or false if not
	 */
	public boolean deleteTag(String tag);
	/**
	 * this function get all the files that connected to the tag
	 * @param tag {@link String} the name of the tag
	 * @return {@link Set} of strings with the paths of all the files
	 */
	public Set<String> getFiles(String tag);
	/**
	 * this function get all the tags that connected to the file
	 * @param path {@link String}  the path of the requested file
	 * @return {@link Set}  of strings with the names of all the tags
	 */
	public Set<String> getTags(String path);
	/**
	 * this function add new tag to the table (if it doesn't exist)
	 * @param file {@link String} the name of the file 
	 * @param path {@link String} the path of the requested file
	 * @return {@link Boolean} true if the operation succeed or false if not
	 */
	public boolean addFile(String file, String path);
	/**
	 * this function delete the requested file (if it's exist)
	 * @param path {@link String} the path of the requested file
	 * @return {@link Boolean} true if the operation succeed or false if not
	 */
	public boolean deleteFile(String path);
	/**
	 * this function return all the files in the system
	 * @return {@link Set} of strings with the paths of all the files
	 */
	public Set<String> getAllFiles();
	/**
	 * this function return all the tags in the system
	 * @return {@link Set} of strings with the paths of all the files
	 */
	public Set<String> getAllTags();
	/**
	 * this function return all the tags in the system
	 * @param YesTags {@link Set} of tags that the user wants the files that connect to them
	 * @param NoTags {@link Set} of tags that the user doesn't wants the files that connect to them
	 * @return {@link Set} of strings with the paths of all the requested files
	 */
	public Set<String> getFileByYesNoTags(Set<String> YesTags, Set<String> NoTags);
	/**
	 * this function delete all the tags from the requested file
	 * @param path {@link String} the path of the requested file
	 * @return {@link Boolean} true if the operation succeed or false if not
	 */
	public boolean removeAllTagFromFile(String path);
}